from django.db import models

# Create your models here.
class User(models.Model):
# 用户名 密码  手机号---模型类
    name = models.CharField(max_length=50,verbose_name="用户名")
    pwd = models.CharField(max_length=100,verbose_name="密码")
    mobile = models.CharField(max_length=11,verbose_name="手机号")
    account = models.CharField(max_length=20, verbose_name='账号')
    age = models.IntegerField(verbose_name='年龄')
    sex = models.CharField(max_length=20, verbose_name='性别')

# 定义元类
    class Meta:
        verbose_name_plural = "用户"
        db_table = "user_tb"    # 指定表名
    def __str__(self):
        return self.name   # 返回对象的描述信息  在admin后台中的效果